#include "Tools.h"
#include "Exception.h"

/*

  This is a test version of the data transfer program used on the multigrid method. It is still underconstruction.

  DONE:
    -Linear Interpolation;
  UNFINISHED:
    -Quadratic Interpolation, Adaptative Interpolation, Conservative Interpolation and all Restriction Methods.

 */

void test_prolongation(int argc,char **argv, int option, string filename);
void test_restriction(int argc,char **argv, int option, string filename);


int main(int argc, char **argv){
	ParUtil::Instance()->init(argc,argv);
	PetscInitialize(&argc,&argv,PETSC_NULL,PETSC_NULL);
	PetscErrorCode ierr;
	try{
		//prolongation
		//test_prolongation(argc,argv,1,"InterpMesh_Const.vtk");
		//test_prolongation(argc,argv,2,"Fine_Linear.vtk");
		test_prolongation(argc,argv,3,"InterpMesh_Quadratic.vtk");
		//test_prolongation(argc,argv,4,"InterpMesh_Cubic.vtk");

		//restriction
		//test_restriction(argc,argv,1,"Restriction_Const.vtk");
		//test_restriction(argc,argv,2,"Restriction_Linear.vtk");
		//test_restriction(argc,argv,3,"Restriction_Quadratic.vtk");
		//test_restriction(argc,argv,4,"Restriction_Cubic.vtk");
		cout << __LINE__ << endl;
		cout << __LINE__ << endl;
	}
	catch (Exception excp) { excp.showMsg(); }
	catch (...) { Exception::unknown_exit(); }

	ParUtil::Instance()->Finalize();
	cout << __LINE__ << endl;
	return 0;
}
